package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.net.domain.BusiMtnChannelRouteListVoTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiMtnChannelRouteTableMapper;
import com.ruoyi.net.domain.BusiMtnChannelRouteTable;
import com.ruoyi.net.service.IBusiMtnChannelRouteTableService;

/**
 * 业务-mtn-channel路由Service业务层处理
 * 
 * @author net
 * @date 2024-12-25
 */
@Service
public class BusiMtnChannelRouteTableServiceImpl implements IBusiMtnChannelRouteTableService 
{
    @Autowired
    private BusiMtnChannelRouteTableMapper busiMtnChannelRouteTableMapper;

    /**
     * 查询业务-mtn-channel路由
     * 
     * @param id 业务-mtn-channel路由主键
     * @return 业务-mtn-channel路由
     */
    @Override
    public BusiMtnChannelRouteTable selectBusiMtnChannelRouteTableById(String id)
    {
        return busiMtnChannelRouteTableMapper.selectBusiMtnChannelRouteTableById(id);
    }

    /**
     * 查询业务-mtn-channel路由列表
     * 
     * @param busiMtnChannelRouteTable 业务-mtn-channel路由
     * @return 业务-mtn-channel路由
     */
    @Override
    public List<BusiMtnChannelRouteListVoTable> selectBusiMtnChannelRouteTableList(BusiMtnChannelRouteTable busiMtnChannelRouteTable)
    {
        return busiMtnChannelRouteTableMapper.selectBusiMtnChannelRouteTableList(busiMtnChannelRouteTable);
    }

    /**
     * 新增业务-mtn-channel路由
     * 
     * @param busiMtnChannelRouteTable 业务-mtn-channel路由
     * @return 结果
     */
    @Override
    public int insertBusiMtnChannelRouteTable(BusiMtnChannelRouteTable busiMtnChannelRouteTable)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMtnChannelRouteTable.getId())) {
            busiMtnChannelRouteTable.setId(uuid);
        }
        busiMtnChannelRouteTable.setCreateBy(SecurityUtils.getUsername());
        busiMtnChannelRouteTable.setCreateTime(DateUtils.getNowDate());
        busiMtnChannelRouteTable.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelRouteTable.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelRouteTableMapper.insertBusiMtnChannelRouteTable(busiMtnChannelRouteTable);
    }

    /**
     * 修改业务-mtn-channel路由
     * 
     * @param busiMtnChannelRouteTable 业务-mtn-channel路由
     * @return 结果
     */
    @Override
    public int updateBusiMtnChannelRouteTable(BusiMtnChannelRouteTable busiMtnChannelRouteTable)
    {
        busiMtnChannelRouteTable.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelRouteTable.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelRouteTableMapper.updateBusiMtnChannelRouteTable(busiMtnChannelRouteTable);
    }

    /**
     * 批量删除业务-mtn-channel路由
     * 
     * @param ids 需要删除的业务-mtn-channel路由主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelRouteTableByIds(String[] ids)
    {
        return busiMtnChannelRouteTableMapper.deleteBusiMtnChannelRouteTableByIds(ids);
    }

    /**
     * 删除业务-mtn-channel路由信息
     * 
     * @param id 业务-mtn-channel路由主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelRouteTableById(String id)
    {
        return busiMtnChannelRouteTableMapper.deleteBusiMtnChannelRouteTableById(id);
    }
}
